id/email
password
forgot password | create account
about | help | prefs
ReadingBatcode reading practice

 

 

Lambda IntroNoArgLambda2

prev  |  next  |  chance

val constVal: () -> Int = { 4 }

fun funcNoArg2(i: Int): Int = i * constVal.invoke()

Function Call  Return Value
funcNoArg2(5)
funcNoArg2(10)
funcNoArg2(20)

Experiment with this code on Gitpod.io or as a Kotlin Playground

⬅ Back